This page last changed on Nov 08, 2007 by pburney.

Setting up a local Global Lab development site

Install Apache, PHP and MySQL on your system

The code was developed on Mac OS X and is currently running on a Linux server. If you plan to develop on a Windows machine, you may need to make some adjustments to the code related to file paths as well as customize the setup of the tools for your software versions.

Apache should be version 2 or greater.

MySQL should be version 4.1 or greater.

PHP should be version 5 or greater.

Create the Database and Set Permissions

Grab the database exports from here:

http://dev.concord.org/database/globallab.sql.gz http://dev.concord.org/database/mystery.sql.gz

Login to your local MySQL server as the root user.

Create the Global Lab database:

mysql> CREATE DATABASE global_lab;

Grant access to a global lab user.

mysql> GRANT ALL PRIVILEGES ON global_lab.* TO global_lab_admin@'%' IDENTIFIED BY 'your_password';

Switch to using that database

mysql> use global_lab

Import data from an exported file.

mysql> SOURCE /path/to/gl/file.sql
mysql> SOURCE /path/to/mystery/file.sql

Install the Codebase

Create a directory to house various web files

% mkdir /web

Create a directory to store log files and make that directory writable by the webserver

mkdir /web/logs
chmod 777 /web/logs

Change to the web directory

% cd /web

Check out a fresh copy of the code from the subversion repository

svn co https://username@globallab.svn.concord.org/globallab/trunk/ globallab.concord.org

Copy the distributed configuration file and add in your own development database passwords, server paths, etc.

cd globallab.concord.org/configuration/
cp configuration-dist.php configuration.php

The key changes to make are in these items:

$gl_config['mystery_database_connection'] = 'mysql://user:password@localhost/global_lab';
$gl_config['gl_database_connection'] = 'mysql://user:password@localhost/global_lab';
$gl_config['gmap_key'] = 'ABQIAAAAsRPHTdswOWS_4qvTG9M3MxSM1oT3GSbBj613PS-UkXVLLC5xLRSA-YNXo0Gf_3og3eWp5gQBcY8GoQ';
$gl_config['error_log'] = '/web/logs/gl_error_log';
$gl_config['security_log'] = '/web/logs/gl_security_log';
$gl_config['cookie_domain'] = '.concord.local';
$gl_config['image_upload_directory'] = '/web/globallab.dev.concord.org/images/classes';

Now ensure that classes will have permission to upload photos:

chmod 777 /web/globallab.concord.org/images/classes/

Setup the appropriate Host information

For local development, it's easiest to use a name like globallab.concord.local. To get your machine to understand that, you'll need to edit the hosts file.

On Macs and Linux, the file is at /etc/hosts.

On Windows, the file is at \WINDOWS\system32\drivers\etc\hosts

You'll need to add a line like this to the file:

127.0.0.1    globallab.concord.local

Setup the Virtual Host in the Apache

Edit the httpd.conf file and add the following lines to it:

<Directory /web>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride All
	Order allow,deny
	Allow from all
</Directory>

NameVirtualHost *

<VirtualHost *>
    ServerAdmin webmaster@concord.org
    DocumentRoot /web/globallab.concord.org
    ServerName globallab.concord.org
    ServerAlias globallab.concord.local
    ErrorLog /var/log/httpd/error_log
    CustomLog /var/log/httpd/access_log common
</VirtualHost>

Try the site

Now the site should be set up and working. If the site isn't running, check the error log. A nice way to do this is to use the tail command with the -f parameter in a terminal window. It will update with any changes to the file:

tail -f /var/log/gl_error_log

Do development

Do your development of the site now. When you are done and everything is working locally...

Commit your changes

You can commit your changes when you are done, using something like this syntax:

cd /web/globallab.concord.org
svn commit -m 'INITIALS: comments about current check in' files-to-be-committed

If you omit the files to be committed, all files in that directory downward will be committed

Update the Development Server

Once you're sure your changes are good and not breaking anything, you can update the development server:

http://dev.concord.org/deploy/globallab-dev/

Then check the development server to see if everything is working.

http://globallab.dev.concord.org/

If it is, tell project members to look at the work you've done. After the work is approved, Paul Burney will move the changes to the PRODUCTION server

Document generated by Confluence on Jan 27, 2014 16:42